/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpa;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author admin
 */
@Entity
@Table(name = "credenzialiUtente")
@NamedQueries({
    @NamedQuery(name = "CredenzialiUtente.findAll", query = "SELECT c FROM CredenzialiUtente c"),
    @NamedQuery(name = "CredenzialiUtente.findByUsername", query = "SELECT c FROM CredenzialiUtente c WHERE c.username = :username"),
    @NamedQuery(name = "CredenzialiUtente.findByStudenteid", query = "SELECT c FROM CredenzialiUtente c WHERE c.studenteid = :studenteid"),
    @NamedQuery(name = "CredenzialiUtente.findByPassword", query = "SELECT c FROM CredenzialiUtente c WHERE c.password = :password")})
public class CredenzialiUtente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "username")
    private String username;
    @Column(name = "studenteid")
    private Integer studenteid;
    @Column(name = "password")
    private String password;

    public CredenzialiUtente() {
    }

    public CredenzialiUtente(String username) {
        this.username = username;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getStudenteid() {
        return studenteid;
    }

    public void setStudenteid(Integer studenteid) {
        this.studenteid = studenteid;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (username != null ? username.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CredenzialiUtente)) {
            return false;
        }
        CredenzialiUtente other = (CredenzialiUtente) object;
        return (this.username != null || other.username == null) && (this.username == null || this.username.equals(other.username));
    }

    @Override
    public String toString() {
        return "jpa.CredenzialiUtente[username=" + username + "]";
    }

}
